home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / tsbat27.zip / LOGRUN.BAT < prev    next >
DOS Batch File  |  1991-07-10  |  2KB  |  59 lines

  1. echo off
  2. echo ┌───────────────────────────────────────────────────┐
  3. echo │ Record program usage                              │
  4. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, 10-Jul-91 │
  5. echo └───────────────────────────────────────────────────┘
  6.  
  7. rem The purpose of this batch is to record program usage to
  8. rem a program usage log file
  9. rem *******************************************************
  10.  
  11. rem The path and name of the logfile:
  12. rem Change the path to suit yours!
  13. rem If you get an "Out of environment space" message, increase your
  14. rem environment space by using shell configuration in config.sys:
  15. rem Example: shell=c:\bin\command.com /e:1024 /p
  16. if not exist r:\nul goto _err2
  17. set logfile_=r:\proguse.log
  18.  
  19. rem Check for errors
  20. if "%1"=="" goto _help
  21. if not exist %1 goto _err1
  22.  
  23. rem Record time and date
  24. echo Calling %1 at >> %logfile_%
  25. echo.|time >> %logfile_%
  26. echo.|date >> %logfile_%
  27.  
  28. rem Here the actual program is called.
  29. rem %1 is the name of the program, and it must include the path and
  30. rem the extension.
  31. rem If you do not want to have to use the path, make another batch
  32. rem which calls your program by calling this batch. See link1.bat
  33. rem and link2.bat for how to call a batch from another batch.
  34. rem %2 through %9 take care of the parameters possibly needed in
  35. rem your program call
  36. %1 %2 %3 %4 %5 %6 %7 %8 %9
  37.  
  38. rem Concluding message
  39. echo ******************************************************************* >> %logfile_%
  40. echo Usage of %1 recorded to %logfile_%
  41. goto _out
  42.  
  43. :_err1
  44. echo File %1 not found
  45. goto _out
  46.  
  47. :_err2
  48. echo The drive or directory for proguse.log not found, see batch remarks
  49. goto _out
  50.  
  51. :_help
  52. echo.
  53. echo Usage: LOGRUN ProgramNameWithPathAndExtension [param1] [param2] [...]
  54. echo.
  55. echo See the remarks in LOGRUN.BAT for more information
  56. :_out
  57. set logfile_=
  58. echo on
  59.